/******************************************************************************
 * Product: Adempiere ERP & CRM Smart Business Solution                       *
 * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved.                *
 * This program is free software, you can redistribute it and/or modify it    *
 * under the terms version 2 of the GNU General Public License as published   *
 * by the Free Software Foundation. This program is distributed in the hope   *
 * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied *
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.           *
 * See the GNU General Public License for more details.                       *
 * You should have received a copy of the GNU General Public License along    *
 * with this program, if not, write to the Free Software Foundation, Inc.,    *
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.                     *
 * For the text or an alternative of this public license, you may reach us    *
 * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA        *
 * or via info@compiere.org or http://www.compiere.org/license.html           *
 *****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package org.compiere.model;

import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Properties;
import org.compiere.util.Env;

/** Generated Model for hrm_limitholiday
 *  @author Adempiere (generated) 
 *  @version Release 3.7.0LTS - $Id$ */
public class X_hrm_limitholiday extends PO implements I_hrm_limitholiday, I_Persistent 
{

	/**
	 *
	 */
	private static final long serialVersionUID = 20120821L;

    /** the default Constructor */
    public X_hrm_limitholiday(Properties ctx)
    { 
      super (ctx, null, null);
    } 

    /** Standard Constructor */
    public X_hrm_limitholiday (Properties ctx, int hrm_limitholiday_ID, String trxName)
    {
      super (ctx, hrm_limitholiday_ID, trxName);
      /** if (hrm_limitholiday_ID == 0)
        {
			setC_BPartner_ID (0);
			setCloseDate (new Timestamp( System.currentTimeMillis() ));
			setEndDate (new Timestamp( System.currentTimeMillis() ));
			sethrm_daysused (0);
			sethrm_limitdays (0);
			sethrm_limitholiday_ID (0);
			setProcessed (false);
// N
			setStartDate (new Timestamp( System.currentTimeMillis() ));
        } */
    }

    /** Load Constructor */
    public X_hrm_limitholiday (Properties ctx, ResultSet rs, String trxName)
    {
      super (ctx, rs, trxName);
    }

    /** AccessLevel
      * @return 3 - Client - Org 
      */
    protected int get_AccessLevel()
    {
      return accessLevel.intValue();
    }

    /** Load Meta Data */
    protected POInfo initPO (Properties ctx)
    {
      POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
      return poi;
    }

    public String toString()
    {
      StringBuffer sb = new StringBuffer ("X_hrm_limitholiday[")
        .append(get_ID()).append("]");
      return sb.toString();
    }

	public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException
    {
		return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_Name)
			.getPO(getC_BPartner_ID(), get_TrxName());	}

	/** Set Business Partner .
		@param C_BPartner_ID 
		Identifies a Business Partner
	  */
	public void setC_BPartner_ID (int C_BPartner_ID)
	{
		if (C_BPartner_ID < 1) 
			set_Value (COLUMNNAME_C_BPartner_ID, null);
		else 
			set_Value (COLUMNNAME_C_BPartner_ID, Integer.valueOf(C_BPartner_ID));
	}

	/** Get Business Partner .
		@return Identifies a Business Partner
	  */
	public int getC_BPartner_ID () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/** Set Close Date.
		@param CloseDate 
		Close Date
	  */
	public void setCloseDate (Timestamp CloseDate)
	{
		set_Value (COLUMNNAME_CloseDate, CloseDate);
	}

	/** Get Close Date.
		@return Close Date
	  */
	public Timestamp getCloseDate () 
	{
		return (Timestamp)get_Value(COLUMNNAME_CloseDate);
	}

	/** Set End Date.
		@param EndDate 
		Last effective date (inclusive)
	  */
	public void setEndDate (Timestamp EndDate)
	{
		set_Value (COLUMNNAME_EndDate, EndDate);
	}

	/** Get End Date.
		@return Last effective date (inclusive)
	  */
	public Timestamp getEndDate () 
	{
		return (Timestamp)get_Value(COLUMNNAME_EndDate);
	}

	/** Set hrm_days.
		@param hrm_days hrm_days	  */
	public void sethrm_days (BigDecimal hrm_days)
	{
		set_Value (COLUMNNAME_hrm_days, hrm_days);
	}

	/** Get hrm_days.
		@return hrm_days	  */
	public BigDecimal gethrm_days () 
	{
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_hrm_days);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	/** Set days used.
		@param hrm_daysused days used	  */
	public void sethrm_daysused (int hrm_daysused)
	{
		set_Value (COLUMNNAME_hrm_daysused, Integer.valueOf(hrm_daysused));
	}

	/** Get days used.
		@return days used	  */
	public int gethrm_daysused () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_hrm_daysused);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/** Set hrm_holidayreserve.
		@param hrm_holidayreserve hrm_holidayreserve	  */
	public void sethrm_holidayreserve (BigDecimal hrm_holidayreserve)
	{
		set_Value (COLUMNNAME_hrm_holidayreserve, hrm_holidayreserve);
	}

	/** Get hrm_holidayreserve.
		@return hrm_holidayreserve	  */
	public BigDecimal gethrm_holidayreserve () 
	{
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_hrm_holidayreserve);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	/** Set limit days.
		@param hrm_limitdays limit days	  */
	public void sethrm_limitdays (int hrm_limitdays)
	{
		set_Value (COLUMNNAME_hrm_limitdays, Integer.valueOf(hrm_limitdays));
	}

	/** Get limit days.
		@return limit days	  */
	public int gethrm_limitdays () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_hrm_limitdays);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/** Set hrm_limitholiday.
		@param hrm_limitholiday_ID hrm_limitholiday	  */
	public void sethrm_limitholiday_ID (int hrm_limitholiday_ID)
	{
		if (hrm_limitholiday_ID < 1) 
			set_ValueNoCheck (COLUMNNAME_hrm_limitholiday_ID, null);
		else 
			set_ValueNoCheck (COLUMNNAME_hrm_limitholiday_ID, Integer.valueOf(hrm_limitholiday_ID));
	}

	/** Get hrm_limitholiday.
		@return hrm_limitholiday	  */
	public int gethrm_limitholiday_ID () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_hrm_limitholiday_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	public I_hrm_order gethrm_order() throws RuntimeException
    {
		return (I_hrm_order)MTable.get(getCtx(), I_hrm_order.Table_Name)
			.getPO(gethrm_order_ID(), get_TrxName());	}

	/** Set hrm_order.
		@param hrm_order_ID hrm_order	  */
	public void sethrm_order_ID (int hrm_order_ID)
	{
		if (hrm_order_ID < 1) 
			set_Value (COLUMNNAME_hrm_order_ID, null);
		else 
			set_Value (COLUMNNAME_hrm_order_ID, Integer.valueOf(hrm_order_ID));
	}

	/** Get hrm_order.
		@return hrm_order	  */
	public int gethrm_order_ID () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_hrm_order_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/** Set hrm_salaryrange.
		@param hrm_salaryrange_ID hrm_salaryrange	  */
	public void sethrm_salaryrange_ID (BigDecimal hrm_salaryrange_ID)
	{
		set_Value (COLUMNNAME_hrm_salaryrange_ID, hrm_salaryrange_ID);
	}

	/** Get hrm_salaryrange.
		@return hrm_salaryrange	  */
	public BigDecimal gethrm_salaryrange_ID () 
	{
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_hrm_salaryrange_ID);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	/** Set Processed.
		@param Processed 
		The document has been processed
	  */
	public void setProcessed (boolean Processed)
	{
		set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
	}

	/** Get Processed.
		@return The document has been processed
	  */
	public boolean isProcessed () 
	{
		Object oo = get_Value(COLUMNNAME_Processed);
		if (oo != null) 
		{
			 if (oo instanceof Boolean) 
				 return ((Boolean)oo).booleanValue(); 
			return "Y".equals(oo);
		}
		return false;
	}

	/** Set Start Date.
		@param StartDate 
		First effective day (inclusive)
	  */
	public void setStartDate (Timestamp StartDate)
	{
		set_Value (COLUMNNAME_StartDate, StartDate);
	}

	/** Get Start Date.
		@return First effective day (inclusive)
	  */
	public Timestamp getStartDate () 
	{
		return (Timestamp)get_Value(COLUMNNAME_StartDate);
	}
}